# -*- coding: utf-8 -*-
# @Author  : pony.guan
# @Time    : 2022/1/11 15:24
# Description:


import os
from config import debug

gui_name_pre = os.path.basename(os.path.dirname(os.path.abspath(__file__)))


def unpack_gui_test(spec=False):
    print('测试版')
    gui_name = gui_name_pre + '_测试版'
    gui_name = 'Tote Reorganization'
    print(f'----开始打包{gui_name}------')
    if spec:
        spec_file = gui_name + '.spec'
        os.system(f'pyinstaller {spec_file}')
    else:
        os.system(f'pyinstaller -F -w -i logo3.ico  -n {gui_name} main.py')

    print(f'----{gui_name}打包完成------\n')


def unpack_gui_master(spec=False):
    print('正式版')
    gui_name = gui_name_pre + '_正式版'
    gui_name = 'Tote Reorganization'
    print(f'----开始打包{gui_name}------')
    if spec:
        spec_file = gui_name + '.spec'
        os.system(f'pyinstaller {spec_file}')
    else:
        os.system(f'pyinstaller -F -w -n {gui_name} main.py')
    print(f'----{gui_name}打包完成------\n')


if __name__ == '__main__':
    if debug:
        unpack_gui_test()
    else:
        unpack_gui_master()
